dal_database = require("./DataBase");

exports.getList = function (callback){
	dal_database.db.query("SELECT * FROM post", function(err, res, fields) {
		if (err) throw err;
		callback(res);
	});
};

exports.insert = function (title, callback){
	dal_database.db.query("INSERT IGNORE INTO post SET postType_Id=1 AND title='" + title + "', postDate='" + new Date().toJSON() + "'", function(err, res, fields) {
		if (err) throw err;
	});
	callback(res);
};
